package com.boyon.system.provider;

import org.springframework.stereotype.Service;

import com.boyon.hbm.criteria.OperationType;
import com.boyon.hbm.criteria.Param;
import com.boyon.hbm.criteria.Query;
import com.boyon.service.AbstractService;
import com.boyon.service.ConfigProviderService;
import com.boyon.system.entity.Config;

/**
 * ClassName:ConfigProviderServiceImpl <br/>
 * Function: 配置服务提供程序实现类. <br/>
 * Date: 2018年4月5日 下午1:24:38 <br/>
 * 
 * @author sunshulin
 * @version
 * @since JDK 1.8
 * @see
 */
@Service("configProviderService")
public class ConfigProviderServiceImpl extends AbstractService
		implements ConfigProviderService {

	/**
	 * 获取系统配置信息.
	 * 
	 * @see com.boyon.service.ConfigProviderService#getConfigByKey(java.lang.String)
	 */
	public String getConfigByKey(String key) {
		Query query = new Query();
		query.addParam(new Param<String>("configKey", OperationType.eq, key));
		Config config = generalDao.sign(Config.class, query);
		return config.getConfigValue();
	}

}
